From 3d96077b2f41475d7311f89a2908fac31aadb21a Mon Sep 17 00:00:00 2001 From: Eli Zaretskii Date: Mon, 16 Feb 2004 11:42:10 +0000 Subject: [PATCH] (rmail-dont-reply-to): Anchor user login name and email address at the beginning and end of the address. --- lisp/mail/mail-utils.el | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/lisp/mail/mail-utils.el b/lisp/mail/mail-utils.el index e60e8358de9..96a57b38f07 100644 --- a/lisp/mail/mail-utils.el +++ b/lisp/mail/mail-utils.el @@ -227,9 +227,15 @@ the comma-separated list. The pruned list is returned." "") (if (and user-mail-address (not (equal user-mail-address user-login-name))) - (concat (regexp-quote user-mail-address) "\\|") + ;; Anchor the login name and email address so + ;; that we don't match substrings: if the + ;; login name is "foo", we shouldn't match + ;; "barfoo@baz.com". + (concat "\\`" + (regexp-quote user-mail-address) + "\\'\\|") "") - (concat (regexp-quote user-login-name) "\\>")))) + (concat "\\`" (regexp-quote user-login-name) "@")))) ;; Split up DESTINATIONS and match each element separately. (let ((start-pos 0) (cur-pos 0) (case-fold-search t)) -- 2.30.2